Text File | 1999-03-31 | 786 b | 15 lines | [TEXT/R*ch]
SpriteTest (PacManOnMars)
by Matt Neuburg
matt@tidbits.com
http://www.tidbits.com/matt/
A simple spriteSurface game animation. Use the arrow-keys to aim PacMan so he eats the ghosts. Many thanks to Alex Metcalf for letting me use the animated drawings from his Maniac game.
The example shows two abstract classes, SmartSurface (a spritesurface subclass) and SmartSprite (a sprite wrapper) which together make both surface and sprites far more object-oriented and self-contained. Instead of the spritesurface having to drive everything, the redraw and collision events are shunted off to the sprites themselves so they can act as befits their nature.
Also takes advantage of a few new RB 2.0 features like constructors and constants.